package cn.school.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 任务提交表
 * @TableName task_submissions
 */
@TableName(value ="task_submissions")
@Data
public class TaskSubmissions implements Serializable {
    /**
     * 
     */
    @TableId
    private Integer id;

    /**
     * 关联的任务id
     */
    private Integer taskId;

    /**
     * 提交的学生id
     */
    private Integer studentId;

    /**
     * 提交的文本内容
     */
    private String content;

    /**
     * 提交状态(1:已提交,2:被驳回,3:已批准)
     */
    private Integer status;

    /**
     * 提交时间
     */
    private Date careteTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 教师意见
     */
    private String teacherFeedback;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TaskSubmissions other = (TaskSubmissions) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTaskId() == null ? other.getTaskId() == null : this.getTaskId().equals(other.getTaskId()))
            && (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCareteTime() == null ? other.getCareteTime() == null : this.getCareteTime().equals(other.getCareteTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getTeacherFeedback() == null ? other.getTeacherFeedback() == null : this.getTeacherFeedback().equals(other.getTeacherFeedback()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCareteTime() == null) ? 0 : getCareteTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getTeacherFeedback() == null) ? 0 : getTeacherFeedback().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", taskId=").append(taskId);
        sb.append(", studentId=").append(studentId);
        sb.append(", content=").append(content);
        sb.append(", status=").append(status);
        sb.append(", careteTime=").append(careteTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", teacherFeedback=").append(teacherFeedback);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}